package scala.collection.mutable

object ListTest1 {
  def main(args: Array[String]): Unit = {
    //    1.创建一个可变集合
    val l1 = ListBuffer[Int](1, 6, 7, 8, 19)
    val l2 = ListBuffer[Int](29, 39, 30, 11)
    println(l1)
    println("----------")

    //    2.向集合中添加数据
    l1.+=(30)
    l2.+=(100)
    println(l1)
    println(l2)
    println("----------")

    l1.append(6, 7)
    l2.append(44, 32)
    println(l1)
    println(l2)
    println("----------")

    l1.insert(0, 0)
    l2.insert(0, 0)
    println(l1)
    println(l2)
    println("----------")

    l1 += 9 += 2
    l2 += 22 += 21
    println(l1)
    println(l2)
    println("----------")

    1990 +=: l1
    2000 +=: l2
    println(l1)
    println(l2)
    println("----------")

    l1(1) = 11
    l2.update(0, 22)
    println(l1)
    println(l2)
    println("----------")

    //    println(l1.-(5))
    println("----------")

    println(l1)
    l1.-=(5)
    println("----------")


    val buffer1 = l1.remove(1)
    println(buffer1)

    val l3 = l1 ++ l2
    println(l3)

    l1 ++= l2
    println(l1)

  }
}
